package com.umeox.watch.moto.dataservice.db.dao;


import android.database.Cursor;

import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.ContactInfo;

import java.util.List;

@Dao
public interface ContactDao {
    @Query("SELECT * FROM contact_info")
    List<ContactInfo> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(@NonNull ContactInfo contactInfo);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(@NonNull List<ContactInfo> contactInfoList);

    @Delete
    int delete(ContactInfo contactInfo);

    @Delete
    void delete(List<ContactInfo> contactInfoList);

    @Query("DELETE FROM contact_info")
    int deleteAll();

    @Query("SELECT * FROM contact_info")
    Cursor query();
}
